<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<c:choose>
<c:when test="${sessionScope.admin==null}">
	<script type="text/javascript">
	$(document).ready(function(){
		if(${sessionScope.admin==null}){
			alert("로그인 후 이용 가능합니다.");
			location.href="admin.do";
		}
	});
</script>	
</c:when>
<c:otherwise>
<center>
<h1>공지사항</h1>
<table>
<tr>
	<td>번호:${requestScope.nvo.no }</td><td>제목:${requestScope.nvo.title }</td>
</tr>
<tr>
	<td>작성일시:${requestScope.nvo.datePosted }</td><td>조회수:${requestScope.nvo.hits }</td>
</tr>
<tr>
	<td colspan="2">
	<a href="downloadNoticeFile.do?savFileName=${requestScope.nvo.savFileName}">${requestScope.nvo.savFileName}</a>
	</td>
</tr>
<tr>
	<td colspan="2"><textarea rows="20" cols="50">${requestScope.nvo.content }</textarea></td>
</tr>
<tr>
	<td colspan="2" align="center">
	<a href="noticeListForAdmin.do"><input type="button" value="목록"></a>
	<a href="updateNoticePageForAdmin.do?no=${requestScope.nvo.no }"><input type="button" value="수정하기"></a>
	<a href="deleteNoticeForAdmin.do?no=${requestScope.nvo.no }"><input type="button" value="삭제" id="deleteNoticeBtn"></a>
	</td>
</tr>
</table>
</center>
</c:otherwise>
</c:choose>